Skip to content

Use data driven testing #4 - #6

Merged
pombredanne merged 9 commits into
mainfrom
4-data-driven-testing
Oct 3, 2020
Merged

Use data driven testing #4#6
pombredanne merged 9 commits into
mainfrom
4-data-driven-testing

Conversation

@pombredanne

Copy link
Copy Markdown
Member

This move most tests to datadriven using the original
code pushed by @JonoYang

JonoYang and others added 9 commits October 3, 2020 16:16
Signed-off-by: Jono Yang <jyang@nexb.com>
This help separate more complex tests from the ones that can be entirely
data-driven.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Test all attributes from contenttype.Type object by adding a new
to_dict() function and enhancing the FileTypeTest with all these
attributes. At test time, test all attributes but check only with
startswith() for text attributes rather than full equality.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This was done by collecting the list of touched files (with a temp
override of get_test_loc() ) then touch empty yaml files and
regenerating the tests. Finally the yaml files have been hand reviewed
for correctness.

All tests with complex expectations have been kept as-is and not
migrated to data-driven tests


Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne
pombredanne merged commit 18b66e0 into main Oct 3, 2020
@pombredanne
pombredanne deleted the 4-data-driven-testing branch October 5, 2020 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants